package com.sheep.pattern.singleton;

/**
 * 懒汉式创建单例模式
 * @author wangze
 * @date 2021-01-12 10:49.
 **/
public class LazySingletonTest {

	private  static  LazySingletonTest instance;

	private  LazySingletonTest (){

	}

	public synchronized static  LazySingletonTest getInstance(){
		if(instance==null){
			instance=new LazySingletonTest();
			return instance;
		}
		return  instance;
	}

}
